import Vue from 'vue'
import entry from './app.vue'
import router from './router/index'
import Robert from '../src/index'
import hljs from 'highlight.js'
import '../src/theme-chalk/src/index.scss'
// import Robert from "robert-ui/lib/robert-ui.common";
// import "robert-ui/lib/index.css";

import demoBlock from './components/demo-block.vue'
import sideNav from './components/side-nav.vue'
import './demo-styles/index.scss'
Vue.component('demo-block', demoBlock)
Vue.component('side-nav', sideNav)
Vue.use(Robert)

import './assets/styles/common.scss'

router.afterEach(() => {
  // https://github.com/highlightjs/highlight.js/issues/909#issuecomment-131686186
  Vue.nextTick(() => {
    const blocks = document.querySelectorAll('pre code:not(.hljs)')
    Array.prototype.forEach.call(blocks, hljs.highlightBlock)
  })
})

import icon from './icon.json'
Vue.prototype.$icon = icon // Icon 列表页用

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  render: (h) => h(entry)
})
